#include <stdio.h>

int main(void)
{
	int n, i, sum = 0;

	printf("Input a positive integer: ");
	scanf("%d", &n);
	for (i = 1; i <= n; i++)
		sum += i;
	printf("sum = %d\n", sum);

	return 0;
}